const { ccclass, property } = cc._decorator;

import n from "./EngineUtil";
import l from "./BasePageCtrl";
import s from "./MatchGameFlyBoxToastPage";

@ccclass
export default class MatchGameFlyBoxToastPageCtrl extends l {
    @property(cc.Node)
    ui = null;

    onLoad() {
        super.onLoad();
        this.onUILoad();
        this._animType =AnimType.NONE;
        this._touchControl = false;
        this._hasPeneLock = false;
        this._hasBlack = false;
        this._hasTouchLock = false;
        this._hasBlackTouch = false;
        this.addButtonListen();
    }

    start() {}

    onUILoad() {
        this.ui = this.node.addComponent(s);
    }

    _init(e?) {
        this.node.opacity = 255;
        var a = e.cash;
        this.ui.countLabel.getComponent(cc.Label).string = "-" + n.getCashBalance(a) + "元";
        cc.tween(this.node).delay(2).to(.5, {
            opacity: 0
        }).call(() => {
            this.clickClose();
        }).start();
    }

    addButtonListen() {}

    clickClose() {
        this.hide();
    }
}
